package day03;

/**
 * @author feng
 * @Date 2021/7/19 17:11
 */
public class Test02 {
    public static void main(String[] args) {
        TestYield test = new TestYield();
        new Thread(test, "a").start();
        new Thread(test, "b").start();

    }

}

class TestYield implements Runnable {

    @Override
    public void run() {
        System.out.println("线程开始运行...."+Thread.currentThread().getName());
        //线程礼让
        Thread.yield();
        System.out.println("线程结束运行"+Thread.currentThread().getName());

    }
}